package com.xjrsoft.module.test;

import com.xjrsoft.module.organization.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MyRabbitMqConsumer {

    /**
     * 消费mq
     * @param user
     */
    @RabbitHandler
    @RabbitListener(queues = "test")
    public void testConsumer(User user) {
        log.info("消费mq");
        System.out.println("收到消息:" + user.toString());
    }
}
